package com.gao.recursion;

/**
 * @Author: ShanYuqing
 * @Version: v1.0
 */
public class RescursionTest {
    /*
    求1~n的和
     */
    public static void main(String[] args) {
        int qh = qh(9);
        System.out.println(
                qh
        );
    }
    public  static int qh(int num){
        if(num==1){
            return 1;
        }else{
          return num+qh(num-1);
        }
    }
}
